<?php

declare(strict_types=1);

namespace App\Controller;

use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Contract\ResponseInterface;
use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\Di\Annotation\Inject;
use App\Service\PlayletService;
#[AutoController]
class SearchController extends BaseController
{
    #[Inject]
    private PlayletService $playletService;
    public function playlet(RequestInterface $request, ResponseInterface $response)
    {
        $applet_id = $this->get_applet_id();
        $kw = $request->input("kw");
        $rec_data = $this->playletService->search($applet_id,$kw);
        return $this->resultResponse(["data"=>$rec_data]);
    }

}
